You will probably need to do some track-level editing on the tracks your effect will use as sources, depending mainly on the type of effect you choose. There are different considerations for an effect that requires no sources, such as the cloud effect, an effect that requires one source, such as the blur filter, or an effect that requires two or more sources, such as a wipe effect.
An effect component can use any track with video output as a source. Effects are normally applied to video tracks, but a sprite track or a text track can also be a source for an effect. It is even possible to "stack" effects, simply by making one effect track a source for another. Stacking effects this way will make serious real-time demands on the target system's processor, however, and the end result may not be satisfactory on all machines.
Generally speaking, an effect uses an entire video track as a source. A track reference atom of type kTrackModifierReference is added to the source track, causing the output of the source track to be redirected through the effect.
To make a video track into a source track, for example, you call the AddTrackReference function, as shown below.
long addedIndex;
AddTrackReference(theEffectTrack, theSourceTrack,
kTrackModifierReference, &addedIndex);
The kTrackModifierReference track reference sends all of the source track's output to an effect track, even if the effect track has a smaller duration than the source. If you want to apply an effect to just part of a track, you need to create a new track that references the portions of source media that you want the effect to use. This is explained in more detail in the examples below.
| Previous | Chapter Contents | Chapter Top | Next |